import { localCache } from '@/utils/storage'
import hyRequest from '..'
import type { Iaccount } from '@/types'
import { LOGIN_TOKEN } from '@/global/constans'
//用户登录接口
export function accountLoginRequest(account: Iaccount) {
  return hyRequest.post({
    url: 'login',
    data: account
  })
}

//获取用户信息接口
export function getUserInfoById(id: number) {
  return hyRequest.get({
    url: `/users/${id}`
    // headers: {
    //   Authorization: localCache.getStorage(LOGIN_TOKEN)
    // }
  })
}

//获取用户权限的接口
export function getUserMenuByRoleId(id: number) {
  return hyRequest.get({
    url: `/role/${id}/menu`
  })
}
